<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
	prefix="sec"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Telomere</title>
<link rel="shortcut icon" href="<%=path%>/img/logo.png">

<!-- Vendor CSS -->
<link
	href="<%=path%>/vendors/bower_components/animate.css/animate.min.css"
	rel="stylesheet">
<link
	href="<%=path%>/vendors/bower_components/sweetalert2/dist/sweetalert2.min.css"
	rel="stylesheet">
<link
	href="<%=path%>/vendors/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css"
	rel="stylesheet">
<link
	href="<%=path%>/vendors/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css"
	rel="stylesheet">
<link href="<%=path%>/vendors/bower_components/chosen/chosen.css"
	rel="stylesheet">

<!-- CSS -->
<link href="<%=path%>/css/app_1.min.css" rel="stylesheet">
<link href="<%=path%>/css/app_2.min.css" rel="stylesheet">
<link href="<%=path%>/css/custom.css" rel="stylesheet">
<link href="<%=path%>/css/box.css" rel="stylesheet">
</head>

<body>
	<%@ include file="../header.jsp"%>
	<section id="main">
		<%@ include file="../sidebar.jsp"%>
		<section id="content">
			<div class="container">
				<div class="block-header">
					<h2>首页</h2>
				</div>
				<div class="card">
					<div class="card-header">
						<h2>上传Excel <a title="点击下载模板" href="<%=path%>/telo!downloadTemplate.action"><i class="zmdi zmdi-format-valign-bottom"></i></a></h2>
					</div>
					<br />
					<div class="card-body card-padding">
						<div class="row">
							<form class="form-event" id="form-upload" method="post"
								action="<%=path%>/telo!upload.action"
								enctype="multipart/form-data">
								<div class="form-group" style="text-align:center;">
									<label class="label-detail-title">待上传文件：</label>
									<div class="fileinput fileinput-new" data-provides="fileinput">
										<span class="btn btn-primary btn-file m-r-10"> <span
											class="fileinput-new">选择Excel</span> <span
											class="fileinput-exists">更换Excel</span> <input type="file"
											name="myupload" id="upload_file" accept=".xlsx">
										</span> <span class="fileinput-filename"></span> <a href="#"
											class="close fileinput-exists" data-dismiss="fileinput">&times;</a>
									</div>
								</div>
								<div class="form-group" style="text-align:center;">
									<button id="button-upload" type="button" class="btn bgm-green" onclick="upload()"><i class="zmdi zmdi-format-valign-top"></i> 上传</button>
									<span id="span-upload" style="color:#673AB7;font-size:20px;display:none;">…… 正在处理中，请稍等 ……</span>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</section>
	</section>

	<%@ include file="../footer.jsp"%>


	<!-- Javascript Libraries -->

	<script
		src="<%=path%>/vendors/bower_components/jquery/dist/jquery.min.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

	<script
		src="<%=path%>/vendors/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/Waves/dist/waves.min.js"></script>
	<script src="<%=path%>/vendors/bootstrap-growl/bootstrap-growl.min.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/sweetalert2/dist/sweetalert2.min.js"></script>
	<script src="<%=path%>/js/es6-promise.auto.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/moment/min/moment.min.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/autosize/dist/autosize.min.js"></script>
	<script
		src="<%=path%>/vendors/bower_components/chosen/chosen.jquery.js"></script>
	<script src="<%=path%>/vendors/fileinput/fileinput.js"></script>
	<!-- Placeholder for IE9 -->
	<!--[if IE 9 ]>
            <script src="<%=path%>/vendors/bower_components/jquery-placeholder/jquery.placeholder.min.js"></script>
        <![endif]-->
	<script src="<%=path%>/js/app.js"></script>
	<script>
		function upload() {
			if ($('#upload_file').val() == null || $('#upload_file').val() == "") {
				swal("请先选择文件！");
				return false;
			}
			var fileSize = $('#upload_file')[0].files[0].size / 1024 / 1024; //MB
			if (fileSize > 10) {
				swal("文件大小不得超过10MB！");
				return false;
			}
			$('#button-upload').hide();
			$('#span-upload').show();
			$('#form-upload').submit();
		}
		;
	</script>
</body>
</html>